import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)
const store = new Vuex.Store({
  state: {
    nav_resize: false,
    spaces: [],
    selections: []
  },
  mutations: {
    addSpaces (state, newData) {
      state.spaces = newData
    },
    addOpts (state, newData) {
      state.selections = newData
    },
    changeNav (state) {
      // 修改导航栏 伸缩
      state.nav_resize = !state.nav_resize
    }
  },
  getters: {
  },
  plugins: [createPersistedState()]
})
export default store
